package com.theory.mapping;

import com.theory.enums.SqlLabelEnum;

public class MapperStatement {
    private String id;
    private SqlLabelEnum sqlLabelEnum;
    private String Sql;
    private Class<?> resultType;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public SqlLabelEnum getSqlLabelEnum() {
        return sqlLabelEnum;
    }

    public void setSqlLabelEnum(SqlLabelEnum sqlLabelEnum) {
        this.sqlLabelEnum = sqlLabelEnum;
    }

    public String getSql() {
        return Sql;
    }

    public void setSql(String sql) {
        Sql = sql;
    }

    public Class<?> getResultType() {
        return resultType;
    }

    public void setResultType(Class<?> resultType) {
        this.resultType = resultType;
    }


    public static final class Builder {
        private String id;
        private SqlLabelEnum sqlLabelEnum;
        private String Sql;
        private Class<?> resultType;

        private Builder() {
        }

        public static Builder aMapperStatement() {
            return new Builder();
        }

        public Builder setId(String id) {
            this.id = id;
            return this;
        }

        public Builder setSqlLabelEnum(SqlLabelEnum sqlLabelEnum) {
            this.sqlLabelEnum = sqlLabelEnum;
            return this;
        }

        public Builder setSql(String Sql) {
            this.Sql = Sql;
            return this;
        }

        public Builder setResultType(Class<?> resultType) {
            this.resultType = resultType;
            return this;
        }

        public MapperStatement build() {
            MapperStatement mapperStatement = new MapperStatement();
            mapperStatement.setId(id);
            mapperStatement.setSqlLabelEnum(sqlLabelEnum);
            mapperStatement.setSql(Sql);
            mapperStatement.setResultType(resultType);
            return mapperStatement;
        }
    }
}